#ifndef TASKINFO_H_
#define TASKINFO_H_
#include<gtk/gtk.h>
#include "common.h"
/*
"filename varchar(256),    "
"url varchar(1024),    "
"size   INT,"
"progress  INT default 0,"
"status  int  ,"
"create_time  TIMESTAMP  DEFAULT CURRENT_TIMESTAMP);"
*/
typedef struct{
    int id;
    char filename[FILENAME_LEN];
    char url[URL_MAX_LEN];
    int size;
    int progress;
    int status;
    char create_time[FILENAME_LEN];
    GtkTreeRowReference *row;

}Taskinfo;

//插入数据
int InsertTaskInfo(Taskinfo *taskinfo);
//更新数据 
int UpdateTaskInfo(Taskinfo *taskinfo);
//删除数据
int DeleteTaskInfo(Taskinfo *taskinfo);

//查询数据并添加到链表中
int SelectTaskInfoAddToList(void);
//查询单条数据
int SelectTaskInfoSingle(int id, Taskinfo *t);


//输出数据
void PrintTaskInfo(Taskinfo *t);

#endif